-- GENERATED SPELL FOR [Unbound Devastator] --


function spell0_20881(pUnit, Event) --@Deafening Roar,Self--
pUnit:FullCastSpellOnTarget(36887,pUnit)
pUnit:RegisterEvent('Sorts_20881', 5000, 1)
end

function spell1_20881(pUnit, Event) --@Deafening Roar,Self--
pUnit:FullCastSpellOnTarget(38850,pUnit)
pUnit:RegisterEvent('Sorts_20881', 3000, 1)
end

function spell2_20881(pUnit, Event) --@Devastate,n/a--
pUnit:FullCastSpellOnTarget(36891,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20881', 1000, 1)
end

function spell3_20881(pUnit, Event) --@Devastate,n/a--
pUnit:FullCastSpellOnTarget(38849,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20881', 1000, 1)
end

function Sorts_20881(pUnit, Event)
local choix_sorts_20881 = math.random(0, 3)
if choix_sorts_20881 == 0 then
pUnit:RegisterEvent('spell0_20881', 1, 1)
end
if choix_sorts_20881 == 1 then
pUnit:RegisterEvent('spell1_20881', 1, 1)
end
if choix_sorts_20881 == 2 then
pUnit:RegisterEvent('spell2_20881', 1, 1)
end
if choix_sorts_20881 == 3 then
pUnit:RegisterEvent('spell3_20881', 1, 1)
end
end

function mob20881_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20881', math.random(1500, 3000), 1)
end

function mob20881_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20881_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20881_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20881, 1, 'mob20881_Action')
RegisterUnitEvent(20881, 2, 'mob20881_Leave')
RegisterUnitEvent(20881, 3, 'mob20881_Kill')
RegisterUnitEvent(20881, 4, 'mob20881_Die')
